package com.billiards.dao;

import com.billiards.entity.Ball;
import com.billiards.entity.BallAppt;
import com.billiards.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BallApptMapper {

//    int insertBallAppt(BallAppt ballAppt); // 插入预约记录




    @Select("select * from ball_appt")
    public List<BallAppt> getBallApptList();


    @Select("select * from ball_appt  where ballname like concat('%',#{ballname},'%')")
    public List<BallAppt> getBallApptballname(String ballname);




    @Update("update ball_appt set state=#{state},balltime=#{balltime} ,image=#{image},memo=#{memo} where id=#{id}")
    public int updateBallAppt(BallAppt ballAppt);
    @Insert("insert into ball_appt set state=#{state},balltime=#{balltime} ,memo=#{memo}")
    public int updateAddBallAppt(BallAppt ballAppt);

    @Insert(" insert into ball_appt(id, ballname,state, balltime, memo,image,)values (null,#{ballname},#{state},#{ balltime},#{memo},#{image},)")
    public int addAppt(BallAppt ballAppt);




    @Delete("delete from ball_appt where id=#{delId}")
    public int deleteBallAppt(Integer delId);


@Select("select * from ball_appt where username like concat('%',#{username},'%')")
    public List<BallAppt> getBallApptusername(String username);




}


